﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using App1AppHandler;

namespace Reborn_Server.App1AppHandler
{
    public class Spell_DivineJudgement : Buff
    {
        private int WisdomAdded = 5;
        public Spell_DivineJudgement()
        {
            minutesLeft = 10;
        }
        override public void Resume(CreatureBase targetCreatureBase, SpellIcon _spellIcon, int timeRemaining, int castLevel, int castCharacterID, int castInt, int castWis, int optionalValue, string xmlData)
        {
            minutesLeft = timeRemaining;
            base.Resume(targetCreatureBase, _spellIcon, timeRemaining, castLevel, castCharacterID, castInt, castWis, optionalValue, xmlData);
            

            TargetCreatureBase.WisdomAdd = TargetCreatureBase.WisdomAdd + WisdomAdded;
            TargetCreatureBase.Update_Character();

            spellTimer.Start();
        }
        public void Cast(CreatureBase myCreatureBase, int CastLevel, long CreatureGUID)
        {
            List<MapItem> MapItemsWithin12;
            if (base.InitializeCast(myCreatureBase, CastLevel, CreatureGUID, true, out MapItemsWithin12) == false)
                return;

            TargetCreatureBase.WisdomAdd = TargetCreatureBase.WisdomAdd + WisdomAdded;
            TargetCreatureBase.Update_Character();
            TargetCreatureBase.buffManager.UpdateBuffs();

            //Start Spell Timer
            spellTimer.Start();
        }
        public override void RemoveSpell(bool updateBuffs, bool sendMessage)
        {
            base.RemoveSpell(updateBuffs, sendMessage);
            TargetCreatureBase.WisdomAdd = TargetCreatureBase.WisdomAdd - WisdomAdded;

            TargetCreatureBase.Update_Character();
        }
    }
}
